home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / AIAT 1.0.1 / Examples / Sources / DemoIndex.cpp < prev    next >
Encoding:
Text File  |  1997-09-11  |  1.1 KB  |  39 lines  |  [TEXT/CWIE]

  1. /// DemoIndex.cp
  2. //    Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  3.  
  4.  
  5.  
  6. #include "DemoIndex.h"
  7. //#pragma IA_BEGIN_IMPORTS
  8. #include <stdio.h>
  9. //#pragma IA_END_IMPORTS
  10.  
  11. void DemoFlushProgressFn(float percent, void* data);
  12.  
  13. void DemoFlushProgressFn(float percent, void* data) {
  14.     #pragma unused (data)
  15.     printf("flushing: %3.2f\n", percent);
  16. }
  17.  
  18. DemoIndex::DemoIndex(IAStorage* storage, StringPtr rootFolder) :
  19.  
  20.         // glue together selected IACorpus, IAAnalysis and IAIndex implementations
  21.         DEMOINDEXCLASS(storage,
  22.                        rootFolder ? new DEMOCORPUS(rootFolder) : new DEMOCORPUS(),
  23.                        new DEMOANALYSIS()) {
  24.  
  25.     // initialize flush progress parameters
  26.     SetFlushProgressFn(&DemoFlushProgressFn);
  27.     SetFlushProgressFreq(CLOCKS_PER_SEC);                        // one report per second    
  28. }
  29.  
  30. void DemoIndex::AddDoc(IADoc* doc) {
  31.     printf("adding %#s\n", ((HFSDoc*)doc)->GetFileName());
  32.     DEMOINDEXCLASS::AddDoc(doc);                            // run super
  33. }
  34.  
  35. void DemoIndex::DeleteDoc(const IADoc* doc) {
  36.     printf("deleting %#s\n", ((HFSDoc*)doc)->GetFileName());
  37.     DEMOINDEXCLASS::DeleteDoc(doc);                            // run super
  38. }
  39.